﻿@model Mvc.Models.Menu

@{
    ViewBag.Title = "Menus > Edit";
    var options = new AjaxOptions()
                      {
                          Url = Url.Action("Edit", "Menu"),
                          LoadingElementId = "",
                          UpdateTargetId ="content",
                          InsertionMode = InsertionMode.Replace, // <-- Replace the content of DOM element
                          HttpMethod = "POST",
                         
                         
                      };  
}


<h2>Edit</h2>

 @using (Ajax.BeginForm(options)) 
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Menu</legend>

        @Html.HiddenFor(model => model.MenuId)

        <div class="editor-label">
            @Html.LabelFor(model => model.nombre)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.nombre)
            @Html.ValidationMessageFor(model => model.nombre)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.descripcion)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.descripcion)
            @Html.ValidationMessageFor(model => model.descripcion)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.imagen)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.imagen)
            @Html.ValidationMessageFor(model => model.imagen)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

